package com.supermali.entity.npc.finish;

import com.supermali.creater.MapCreater;
import com.supermali.creater.img.ImgHelper;
import com.supermali.creater.img.ImgKey;
import com.supermali.creater.img.ImgLoader;
import com.supermali.system.SystemHelper;

import java.awt.image.BufferedImage;

/**
 * @project runner
 * @Date 2021/3/25
 * @Auth yangrui
 **/
public class HouseFinish extends FinishAbstract {

    public HouseFinish(Double x, Double y, MapCreater mapCreater) {
        super(x, y, mapCreater);
    }

    @Override
    public void finish() {
        // 1、下一关
        SystemHelper systemHelper = getMapCreater().getGameStarter().getSystemHelper();
        systemHelper.nextLevel();
    }

    @Override
    public void init() {
        ImgHelper imgHelper = ImgLoader.getImgHelper(ImgKey.FINISH_FLAG.HOUSE);
        BufferedImage select = imgHelper.select(0);
        this.setBufferedImage(select);
    }
}
